// pages/user/userCenterNew/comps/userInfo/userInfo.js
Component({
    /**
     * 组件的属性列表
     */
    properties: {
        nowDate: String,
        statusBarHeight: String,
        messageInfo: Object,
        userInfo: Object
    },

    /**
     * 组件的初始数据
     */
    data: {
        roleList: ['游客', '普通会员', '店主', '金牌店主', '服务商']
    },

    /**
     * 组件的方法列表
     */
    methods: {
        goMessageCenter: function() {
            wx.navigateTo({
                url: '/pages/messageSystem/messageCenter/messageCenter'
            })
        },
        goAccount: function() {
            wx.navigateTo({
                url: '/pages/user/account/account'
            })
        },

        goIncome: function(e) {
            wx.navigateTo({
                url: '/pages/user/accumulatedIncome/accumulatedIncome?type=' + e.currentTarget.dataset.type
            })
        },

        goContribution: function() {
            wx.navigateTo({
                url: '/pages/user/contribution/contribution'
            })
        },

        empowerUserInfo: function(e) {
            if (e.detail.errMsg == 'getUserInfo:ok') {
                this.triggerEvent('empowerUserInfo', e.detail)
            }
        },

        goUserData: function() {
            wx.navigateTo({
                url: '/pages/user/userData/userData'
            })
        }
    }
})